namespace SeataNet.Core.Common
{
    /// <summary>
    /// 事务常量定义
    /// </summary>
    public static class TransactionConstants
    {
        /// <summary>
        /// 默认事务超时时间（毫秒）
        /// </summary>
        public const int DEFAULT_TIMEOUT = 60000;

        /// <summary>
        /// 默认全局事务超时时间（毫秒）
        /// </summary>
        public const int DEFAULT_GLOBAL_TRANSACTION_TIMEOUT = 60000;

        /// <summary>
        /// 默认全局超时时间（毫秒）
        /// </summary>
        public const int DEFAULT_GLOBAL_TIMEOUT = 60000;
        
        /// <summary>
        /// 全局事务ID前缀
        /// </summary>
        public const string XID_PREFIX = "xid";
        
        /// <summary>
        /// 事务状态：开始
        /// </summary>
        public const int STATUS_BEGIN = 1;
        
        /// <summary>
        /// 事务状态：提交中
        /// </summary>
        public const int STATUS_COMMITTING = 2;
        
        /// <summary>
        /// 事务状态：回滚中
        /// </summary>
        public const int STATUS_ROLLBACKING = 3;
        
        /// <summary>
        /// 事务状态：已提交
        /// </summary>
        public const int STATUS_COMMITTED = 4;
        
        /// <summary>
        /// 事务状态：已回滚
        /// </summary>
        public const int STATUS_ROLLBACKED = 5;
        
        /// <summary>
        /// 事务状态：超时
        /// </summary>
        public const int STATUS_TIMEOUT = 6;
        
        /// <summary>
        /// 事务状态：未知
        /// </summary>
        public const int STATUS_UNKNOWN = 7;
        
        /// <summary>
        /// 分支事务类型：AT
        /// </summary>
        public const string BRANCH_TYPE_AT = "AT";
        
        /// <summary>
        /// 分支事务类型：TCC
        /// </summary>
        public const string BRANCH_TYPE_TCC = "TCC";
        
        /// <summary>
        /// 分支事务类型：SAGA
        /// </summary>
        public const string BRANCH_TYPE_SAGA = "SAGA";
        
        /// <summary>
        /// 分支事务类型：XA
        /// </summary>
        public const string BRANCH_TYPE_XA = "XA";
    }
}